//
//  SCTipsShowView.m
//  Assembly
//
//  Created by 葛悦彣 on 2023/11/21.
//

#import "SCTipsShowView.h"
@interface SCTipsShowView ()

@property (nonatomic ,strong) UIView * makeView;
@property (nonatomic ,strong) GYWclickBlock leftblock;
@property (nonatomic ,strong) GYWclickBlock rightblock;

@end
@implementation SCTipsShowView
+ (instancetype)showviewTitle:(NSString *)title andContent:(NSString *)content andLeftStr:(NSString *)leftStr andRightStr:(NSString *)rightStr andLeftBlock:(GYWclickBlock)leftblock andRightBlock:(GYWclickBlock)rightblock {
    
    SCTipsShowView * view = [SCTipsShowView new];
    view.leftblock = leftblock;
    view.rightblock = rightblock;
    [[DTKTool getCurrentVC].view addSubview:view];
    view.backgroundColor = [UIColor colorWithWhite:0 alpha:0.5];
    view.frame = CGRectMake(0, 0, SCREEN_WIDTH, SCREEN_HEIGHT);
    
    UIView * makeView = [UIView new];
    view.makeView = makeView;
    makeView.backgroundColor = UIColor.whiteColor;
    makeView.frame = CGRectMake(kwt(37.5), (SCREEN_HEIGHT - kwt(185))/2, SCREEN_WIDTH - kwt(75), kwt(185));
    [view addSubview:makeView];
    [DTKTool YJ:kwt(10) andView:makeView];
    
    view.userInteractionEnabled = YES;
    [view addGestureRecognizer:[[UITapGestureRecognizer alloc]initWithTarget:view action:@selector(dissmis)]];
    makeView.userInteractionEnabled = YES;
    [makeView addGestureRecognizer:[[UITapGestureRecognizer alloc]initWithTarget:view action:@selector(noclick)]];
    
    UILabel * titlab = [DTKTool labelWithText:title andFont:kFont(16) andTextColor:KcolorHex(@"#1E2425")];
    [makeView addSubview:titlab];
    titlab.numberOfLines = 2;
    titlab.textAlignment = NSTextAlignmentCenter;
    [titlab mas_makeConstraints:^(MASConstraintMaker *make) {
        make.centerX.offset(0);
        make.top.offset(kwt(24));
        make.width.offset(kwt(245));
    }];
    
    UILabel * contentlab = [DTKTool labelWithText:content andFont:kFont(16) andTextColor:KcolorHex(@"#1E2425")];
    [makeView addSubview:contentlab];
    contentlab.textAlignment = NSTextAlignmentCenter;
    contentlab.numberOfLines = 2;
    [contentlab mas_makeConstraints:^(MASConstraintMaker *make) {
        make.centerX.offset(0);
        make.top.equalTo(titlab.mas_bottom).offset(kwt(12));
    }];
    
    UIButton * qxbtn = [UIButton buttonWithType:UIButtonTypeCustom];
    qxbtn.backgroundColor = UIColor.whiteColor;
    [qxbtn setTitle:leftStr forState:UIControlStateNormal];
    [qxbtn setTitleColor:KcolorHex(@"#1E2425") forState:UIControlStateNormal];
    qxbtn.titleLabel.font = kCFont(16);
    [DTKTool YJBK:kwt(24) andView:qxbtn andWidth:0.5 andColor:KcolorHex(@"#C9C9C9")];
    [qxbtn addTarget:view action:@selector(leftBtnclick) forControlEvents:UIControlEventTouchUpInside];
    [makeView addSubview:qxbtn];
    [qxbtn mas_makeConstraints:^(MASConstraintMaker *make) {
        make.height.offset(kwt(48));
        make.width.offset(kwt(120));
        make.left.offset(kwt(24));
        make.bottom.offset(kwt(-20));
    }];
    
    UIButton * qrbtn = [UIButton buttonWithType:UIButtonTypeCustom];
    [qrbtn setBackgroundImage:[UIImage imageNamed:@"login_button1"] forState:UIControlStateNormal];
    [qrbtn setTitle:rightStr forState:UIControlStateNormal];
    [qrbtn setTitleColor:UIColor.whiteColor forState:UIControlStateNormal];
    qrbtn.titleLabel.font = kCFont(16);
    [DTKTool YJ:kwt(24) andView:qrbtn];
    [qrbtn addTarget:view action:@selector(rightbtnclick) forControlEvents:UIControlEventTouchUpInside];
    [makeView addSubview:qrbtn];
    [qrbtn mas_makeConstraints:^(MASConstraintMaker *make) {
        make.height.offset(kwt(48));
        make.width.offset(kwt(120));
        make.right.offset(kwt(-24));
        make.bottom.offset(kwt(-20));
    }];
    
    [view show];
    
    return  view;
    
    
}

- (void)leftBtnclick{
    if(self.leftblock){
        self.leftblock();
    }
    [self dissmis];
}
- (void)rightbtnclick{
    if(self.rightblock){
        self.rightblock();
    }
    [self dissmis];
}


- (void)show{
    [UIView animateWithDuration:0.25 animations:^{
        self.makeView.frame = CGRectMake(kwt(37.5), (SCREEN_HEIGHT - kwt(185))/2, SCREEN_WIDTH - kwt(75), kwt(185));
    }];
}
- (void)noclick{}
- (void)dissmis{
    [UIView animateWithDuration:0.25 animations:^{
        self.makeView.frame = CGRectMake(SCREEN_HEIGHT, (SCREEN_HEIGHT - kwt(185))/2, SCREEN_WIDTH - kwt(75), kwt(185));
    } completion:^(BOOL finished) {
        [self.subviews makeObjectsPerformSelector:@selector(removeFromSuperview)];
        [self removeFromSuperview];
    }];
}


@end

@interface SCNotOwnedTipsShowView ()

@property (nonatomic ,strong) UIView * makeView;
@property (nonatomic ,strong) GYWclickBlock rightblock;

@end
@implementation SCNotOwnedTipsShowView
+ (instancetype)showviewTitle:(NSString *)title andContent:(NSString *)content andClickBlock:(GYWclickBlock)clickblock{

    SCNotOwnedTipsShowView * view = [SCNotOwnedTipsShowView new];
    view.rightblock = clickblock;
    [[DTKTool getCurrentVC].view addSubview:view];
    view.backgroundColor = [UIColor colorWithWhite:0 alpha:0.5];
    view.frame = CGRectMake(0, 0, SCREEN_WIDTH, SCREEN_HEIGHT);
    
    UIView * makeView = [UIView new];
    view.makeView = makeView;
    makeView.backgroundColor = UIColor.whiteColor;
    makeView.frame = CGRectMake(kwt(37.5), (SCREEN_HEIGHT - kwt(300))/2, SCREEN_WIDTH - kwt(75), kwt(300));
    [view addSubview:makeView];
    [DTKTool YJ:kwt(10) andView:makeView];
    
    view.userInteractionEnabled = YES;
    [view addGestureRecognizer:[[UITapGestureRecognizer alloc]initWithTarget:view action:@selector(dissmis)]];
    makeView.userInteractionEnabled = YES;
    [makeView addGestureRecognizer:[[UITapGestureRecognizer alloc]initWithTarget:view action:@selector(noclick)]];
    
    UIImageView * topimg = kimageView(@"submitted_successfully");
    [makeView addSubview:topimg];
    [topimg mas_makeConstraints:^(MASConstraintMaker *make) {
        make.centerX.offset(0);
        make.top.offset(kwt(20));
        make.width.offset(kwt(100));
    }];
    
    UILabel * titlab = [DTKTool labelWithText:title andFont:kCFont(16) andTextColor:KcolorHex(@"#1E2425")];
    [makeView addSubview:titlab];
    titlab.numberOfLines = 2;
    titlab.textAlignment = NSTextAlignmentCenter;
    [titlab mas_makeConstraints:^(MASConstraintMaker *make) {
        make.centerX.offset(0);
        make.top.offset(kwt(135));
        make.width.offset(kwt(250));
    }];
    
    UILabel * contentlab = [DTKTool labelWithText:content andFont:kFont(16) andTextColor:KcolorHex(@"#1E2425")];
    [makeView addSubview:contentlab];
    contentlab.numberOfLines = 2;
    contentlab.textAlignment = NSTextAlignmentCenter;
    [contentlab mas_makeConstraints:^(MASConstraintMaker *make) {
        make.centerX.offset(0);
        make.top.equalTo(titlab.mas_bottom).offset(kwt(12));
        make.width.offset(kwt(250));
    }];
    
  
    
    UIButton * qrbtn = [UIButton buttonWithType:UIButtonTypeCustom];
    [qrbtn setBackgroundImage:[UIImage imageNamed:@"login_button1"] forState:UIControlStateNormal];
    [qrbtn setTitle:@"我知道了" forState:UIControlStateNormal];
    [qrbtn setTitleColor:UIColor.whiteColor forState:UIControlStateNormal];
    qrbtn.titleLabel.font = kCFont(16);
    [DTKTool YJ:kwt(24) andView:qrbtn];
    [qrbtn addTarget:view action:@selector(rightbtnclick) forControlEvents:UIControlEventTouchUpInside];
    [makeView addSubview:qrbtn];
    [qrbtn mas_makeConstraints:^(MASConstraintMaker *make) {
        make.height.offset(kwt(48));
        make.width.offset(kwt(240));
        make.centerX.offset(0);
        make.bottom.offset(kwt(-20));
    }];
    
    [view show];
    
    return  view;
    
    
}

- (void)rightbtnclick{
    if(self.rightblock){
        self.rightblock();
    }
    [self dissmis];
}


- (void)show{
    [UIView animateWithDuration:0.25 animations:^{
        self.makeView.frame = CGRectMake(kwt(37.5), (SCREEN_HEIGHT - kwt(300))/2, SCREEN_WIDTH - kwt(75), kwt(300));
    }];
}
- (void)noclick{}
- (void)dissmis{
    [UIView animateWithDuration:0.25 animations:^{
        self.makeView.frame = CGRectMake(SCREEN_HEIGHT, (SCREEN_HEIGHT - kwt(300))/2, SCREEN_WIDTH - kwt(75), kwt(300));
    } completion:^(BOOL finished) {
        [self.subviews makeObjectsPerformSelector:@selector(removeFromSuperview)];
        [self removeFromSuperview];
    }];
}
@end

///双行文本提示单按钮
@interface SCTitleTipsShowView ()
@property (nonatomic ,strong) UIView * makeView;
@property (nonatomic ,strong) GYWclickBlock rightblock;

@end
@implementation SCTitleTipsShowView
+ (instancetype)showviewTitle:(NSString *)title andContent:(NSString *)content andClickBlock:(GYWclickBlock)clickblock{

    SCTitleTipsShowView * view = [SCTitleTipsShowView new];
    view.rightblock = clickblock;
    [[DTKTool getCurrentVC].view addSubview:view];
    view.backgroundColor = [UIColor colorWithWhite:0 alpha:0.5];
    view.frame = CGRectMake(0, 0, SCREEN_WIDTH, SCREEN_HEIGHT);
    
    UIView * makeView = [UIView new];
    view.makeView = makeView;
    makeView.backgroundColor = UIColor.whiteColor;
    makeView.frame = CGRectMake(kwt(37.5), (SCREEN_HEIGHT - kwt(165))/2, SCREEN_WIDTH - kwt(75), kwt(165));
    [view addSubview:makeView];
    [DTKTool YJ:kwt(10) andView:makeView];
    
    view.userInteractionEnabled = YES;
    [view addGestureRecognizer:[[UITapGestureRecognizer alloc]initWithTarget:view action:@selector(dissmis)]];
    makeView.userInteractionEnabled = YES;
    [makeView addGestureRecognizer:[[UITapGestureRecognizer alloc]initWithTarget:view action:@selector(noclick)]];
    
    UILabel * titlab = [DTKTool labelWithText:title andFont:kCFont(16) andTextColor:KcolorHex(@"#1E2425")];
    [makeView addSubview:titlab];
    titlab.numberOfLines = 2;
    titlab.textAlignment = NSTextAlignmentCenter;
    [titlab mas_makeConstraints:^(MASConstraintMaker *make) {
        make.centerX.offset(0);
        make.top.offset(kwt(25));
        make.width.offset(kwt(250));
    }];
    
    UILabel * contentlab = [DTKTool labelWithText:content andFont:kFont(16) andTextColor:KcolorHex(@"#1E2425")];
    [makeView addSubview:contentlab];
    contentlab.numberOfLines = 2;
    contentlab.textAlignment = NSTextAlignmentCenter;
    [contentlab mas_makeConstraints:^(MASConstraintMaker *make) {
        make.centerX.offset(0);
        make.top.equalTo(titlab.mas_bottom).offset(kwt(12));
        make.width.offset(kwt(250));
    }];
    
  
    
    UIButton * qrbtn = [UIButton buttonWithType:UIButtonTypeCustom];
    [qrbtn setBackgroundImage:[UIImage imageNamed:@"login_button1"] forState:UIControlStateNormal];
    [qrbtn setTitle:@"我知道了" forState:UIControlStateNormal];
    [qrbtn setTitleColor:UIColor.whiteColor forState:UIControlStateNormal];
    qrbtn.titleLabel.font = kCFont(16);
    [DTKTool YJ:kwt(24) andView:qrbtn];
    [qrbtn addTarget:view action:@selector(rightbtnclick) forControlEvents:UIControlEventTouchUpInside];
    [makeView addSubview:qrbtn];
    [qrbtn mas_makeConstraints:^(MASConstraintMaker *make) {
        make.height.offset(kwt(48));
        make.width.offset(kwt(240));
        make.centerX.offset(0);
        make.bottom.offset(kwt(-20));
    }];
    
    [view show];
    
    return  view;
    
    
}

- (void)rightbtnclick{
    if(self.rightblock){
        self.rightblock();
    }
    [self dissmis];
}


- (void)show{
    [UIView animateWithDuration:0.25 animations:^{
        self.makeView.frame = CGRectMake(kwt(37.5), (SCREEN_HEIGHT - kwt(165))/2, SCREEN_WIDTH - kwt(75), kwt(165));
    }];
}
- (void)noclick{}
- (void)dissmis{
    [UIView animateWithDuration:0.25 animations:^{
        self.makeView.frame = CGRectMake(SCREEN_HEIGHT, (SCREEN_HEIGHT - kwt(165))/2, SCREEN_WIDTH - kwt(75), kwt(165));
    } completion:^(BOOL finished) {
        [self.subviews makeObjectsPerformSelector:@selector(removeFromSuperview)];
        [self removeFromSuperview];
    }];
}
@end
///提交成功
@interface SCSubmitSuccessfullyShowView ()

@property (nonatomic ,strong) UIView * makeView;
@property (nonatomic ,strong) GYWclickBlock leftblock;
@property (nonatomic ,strong) GYWclickBlock rightblock;

@end
@implementation SCSubmitSuccessfullyShowView
+ (instancetype)showviewWithLeftStr:(NSString *)leftStr andRightStr:(NSString *)rightStr andLeftBlock:(GYWclickBlock)leftblock andRightBlock:(GYWclickBlock)rightblock{
    return [self showviewWithImg:@"submitted_successfully" andContent:@"提交成功" LeftStr:leftStr andRightStr:rightStr andLeftBlock:leftblock andRightBlock:rightblock];
}

+ (instancetype)showviewWithImg:(NSString *)img andContent:(NSString *)content LeftStr:(NSString *)leftStr andRightStr:(NSString *)rightStr andLeftBlock:(GYWclickBlock)leftblock andRightBlock:(GYWclickBlock)rightblock{

    SCSubmitSuccessfullyShowView * view = [SCSubmitSuccessfullyShowView new];
    view.leftblock = leftblock;
    view.rightblock = rightblock;
    [[DTKTool getCurrentVC].view addSubview:view];
    view.backgroundColor = [UIColor colorWithWhite:0 alpha:0.5];
    view.frame = CGRectMake(0, 0, SCREEN_WIDTH, SCREEN_HEIGHT);
    
    UIView * makeView = [UIView new];
    view.makeView = makeView;
    makeView.backgroundColor = UIColor.whiteColor;
    makeView.frame = CGRectMake(kwt(37.5), (SCREEN_HEIGHT - kwt(255))/2, SCREEN_WIDTH - kwt(75), kwt(255));
    [view addSubview:makeView];
    [DTKTool YJ:kwt(10) andView:makeView];
    
    view.userInteractionEnabled = YES;
    [view addGestureRecognizer:[[UITapGestureRecognizer alloc]initWithTarget:view action:@selector(dissmis)]];
    makeView.userInteractionEnabled = YES;
    [makeView addGestureRecognizer:[[UITapGestureRecognizer alloc]initWithTarget:view action:@selector(noclick)]];
    UIImageView * topimg = kimageView(img);
    topimg.contentMode = UIViewContentModeScaleAspectFit;
    [makeView addSubview:topimg];
    [topimg mas_makeConstraints:^(MASConstraintMaker *make) {
        make.centerX.offset(0);
        make.top.offset(kwt(20));
        make.width.height.offset(kwt(100));
    }];
    UILabel * titlab = [DTKTool labelWithText:content andFont:kCFont(19) andTextColor:KcolorHex(@"#1E2425")];
    [makeView addSubview:titlab];
    titlab.numberOfLines = 2;
    titlab.textAlignment = NSTextAlignmentCenter;
    [titlab mas_makeConstraints:^(MASConstraintMaker *make) {
        make.centerX.offset(0);
        make.top.offset(kwt(145));
        make.width.offset(kwt(255));
    }];
  
    UIButton * qxbtn = [UIButton buttonWithType:UIButtonTypeCustom];
    qxbtn.backgroundColor = UIColor.whiteColor;
    [qxbtn setTitle:leftStr forState:UIControlStateNormal];
    [qxbtn setTitleColor:KcolorHex(@"#1E2425") forState:UIControlStateNormal];
    qxbtn.titleLabel.font = kCFont(16);
    [DTKTool YJBK:kwt(24) andView:qxbtn andWidth:0.5 andColor:KcolorHex(@"#C9C9C9")];
    [qxbtn addTarget:view action:@selector(leftBtnclick) forControlEvents:UIControlEventTouchUpInside];
    [makeView addSubview:qxbtn];
    [qxbtn mas_makeConstraints:^(MASConstraintMaker *make) {
        make.height.offset(kwt(48));
        make.width.offset(kwt(120));
        make.left.offset(kwt(24));
        make.bottom.offset(kwt(-20));
    }];
    
    UIButton * qrbtn = [UIButton buttonWithType:UIButtonTypeCustom];
    [qrbtn setBackgroundImage:[UIImage imageNamed:@"login_button1"] forState:UIControlStateNormal];
    [qrbtn setTitle:rightStr forState:UIControlStateNormal];
    [qrbtn setTitleColor:UIColor.whiteColor forState:UIControlStateNormal];
    qrbtn.titleLabel.font = kCFont(16);
    [DTKTool YJ:kwt(24) andView:qrbtn];
    [qrbtn addTarget:view action:@selector(rightbtnclick) forControlEvents:UIControlEventTouchUpInside];
    [makeView addSubview:qrbtn];
    [qrbtn mas_makeConstraints:^(MASConstraintMaker *make) {
        make.height.offset(kwt(48));
        make.width.offset(kwt(120));
        make.right.offset(kwt(-24));
        make.bottom.offset(kwt(-20));
    }];
    
    [view show];
    
    return  view;
    
    
}

- (void)leftBtnclick{
    if(self.leftblock){
        self.leftblock();
    }
    [self dissmis];
}
- (void)rightbtnclick{
    if(self.rightblock){
        self.rightblock();
    }
    [self dissmis];
}


- (void)show{
    [UIView animateWithDuration:0.25 animations:^{
        self.makeView.frame = CGRectMake(kwt(37.5), (SCREEN_HEIGHT - kwt(255))/2, SCREEN_WIDTH - kwt(75), kwt(255));
    }];
}
- (void)noclick{}
- (void)dissmis{
    [UIView animateWithDuration:0.25 animations:^{
        self.makeView.frame = CGRectMake(SCREEN_HEIGHT, (SCREEN_HEIGHT - kwt(255))/2, SCREEN_WIDTH - kwt(75), kwt(255));
    } completion:^(BOOL finished) {
        [self.subviews makeObjectsPerformSelector:@selector(removeFromSuperview)];
        [self removeFromSuperview];
    }];
}


@end
///删除主板提示窗
@interface SCDeleteZBShowView ()

@property (nonatomic ,strong) UIView * makeView;
@property (nonatomic ,strong) GYWclickBlock leftblock;
@property (nonatomic ,strong) GYWclickBlock rightblock;

@end
@implementation SCDeleteZBShowView
+ (instancetype)showviewTitle:(NSString *)title andContent:(NSString *)content andLeftStr:(NSString *)leftStr andRightStr:(NSString *)rightStr andLeftBlock:(GYWclickBlock)leftblock andRightBlock:(GYWclickBlock)rightblock {
    
    SCDeleteZBShowView * view = [SCDeleteZBShowView new];
    view.leftblock = leftblock;
    view.rightblock = rightblock;
    [[DTKTool getCurrentVC].view addSubview:view];
    view.backgroundColor = [UIColor colorWithWhite:0 alpha:0.5];
    view.frame = CGRectMake(0, 0, SCREEN_WIDTH, SCREEN_HEIGHT);
    
    UIView * makeView = [UIView new];
    view.makeView = makeView;
    makeView.backgroundColor = UIColor.whiteColor;
    makeView.frame = CGRectMake(kwt(37.5), (SCREEN_HEIGHT - kwt(185))/2, SCREEN_WIDTH - kwt(75), kwt(185));
    [view addSubview:makeView];
    [DTKTool YJ:kwt(10) andView:makeView];
    
    view.userInteractionEnabled = YES;
    [view addGestureRecognizer:[[UITapGestureRecognizer alloc]initWithTarget:view action:@selector(dissmis)]];
    makeView.userInteractionEnabled = YES;
    [makeView addGestureRecognizer:[[UITapGestureRecognizer alloc]initWithTarget:view action:@selector(noclick)]];
    
    UILabel * titlab = [DTKTool labelWithText:title andFont:kCFont(19) andTextColor:KcolorHex(@"#1E2425")];
    [makeView addSubview:titlab];
    titlab.numberOfLines = 2;
    titlab.textAlignment = NSTextAlignmentCenter;
    [titlab mas_makeConstraints:^(MASConstraintMaker *make) {
        make.centerX.offset(0);
        make.top.offset(kwt(24));
        make.width.offset(kwt(245));
    }];
    
    UILabel * contentlab = [DTKTool labelWithText:content andFont:kFont(18) andTextColor:KcolorHex(@"#646E6F")];
    [makeView addSubview:contentlab];
    contentlab.numberOfLines = 2;
    contentlab.textAlignment = NSTextAlignmentCenter;
    [contentlab mas_makeConstraints:^(MASConstraintMaker *make) {
        make.centerX.offset(0);
        make.top.equalTo(titlab.mas_bottom).offset(kwt(12));
        make.width.offset(kwt(245));
    }];
    
    UIButton * qxbtn = [UIButton buttonWithType:UIButtonTypeCustom];
    qxbtn.backgroundColor = UIColor.whiteColor;
    [qxbtn setTitle:leftStr forState:UIControlStateNormal];
    [qxbtn setTitleColor:KcolorHex(@"#1E2425") forState:UIControlStateNormal];
    qxbtn.titleLabel.font = kCFont(16);
    [DTKTool YJBK:kwt(24) andView:qxbtn andWidth:0.5 andColor:KcolorHex(@"#C9C9C9")];
    [qxbtn addTarget:view action:@selector(leftBtnclick) forControlEvents:UIControlEventTouchUpInside];
    [makeView addSubview:qxbtn];
    [qxbtn mas_makeConstraints:^(MASConstraintMaker *make) {
        make.height.offset(kwt(48));
        make.width.offset(kwt(120));
        make.left.offset(kwt(24));
        make.bottom.offset(kwt(-20));
    }];
    
    UIButton * qrbtn = [UIButton buttonWithType:UIButtonTypeCustom];
    [qrbtn setBackgroundImage:[UIImage imageNamed:@"login_button1"] forState:UIControlStateNormal];
    [qrbtn setTitle:rightStr forState:UIControlStateNormal];
    [qrbtn setTitleColor:UIColor.whiteColor forState:UIControlStateNormal];
    qrbtn.titleLabel.font = kCFont(16);
    [DTKTool YJ:kwt(24) andView:qrbtn];
    [qrbtn addTarget:view action:@selector(rightbtnclick) forControlEvents:UIControlEventTouchUpInside];
    [makeView addSubview:qrbtn];
    [qrbtn mas_makeConstraints:^(MASConstraintMaker *make) {
        make.height.offset(kwt(48));
        make.width.offset(kwt(120));
        make.right.offset(kwt(-24));
        make.bottom.offset(kwt(-20));
    }];
    
    [view show];
    
    return  view;
    
    
}

- (void)leftBtnclick{
    if(self.leftblock){
        self.leftblock();
    }
    [self dissmis];
}
- (void)rightbtnclick{
    if(self.rightblock){
        self.rightblock();
    }
    [self dissmis];
}


- (void)show{
    [UIView animateWithDuration:0.25 animations:^{
        self.makeView.frame = CGRectMake(kwt(37.5), (SCREEN_HEIGHT - kwt(185))/2, SCREEN_WIDTH - kwt(75), kwt(185));
    }];
}
- (void)noclick{}
- (void)dissmis{
    [UIView animateWithDuration:0.25 animations:^{
        self.makeView.frame = CGRectMake(SCREEN_HEIGHT, (SCREEN_HEIGHT - kwt(185))/2, SCREEN_WIDTH - kwt(75), kwt(185));
    } completion:^(BOOL finished) {
        [self.subviews makeObjectsPerformSelector:@selector(removeFromSuperview)];
        [self removeFromSuperview];
    }];
}


@end


@interface DTPerfectIdentityShowView ()<UITextFieldDelegate>

@property (nonatomic ,strong) UIView * makeView;
@property (nonatomic ,strong) UITextField * nameText;
@property (nonatomic ,strong) void(^block)(NSString * sn);

@end

@implementation DTPerfectIdentityShowView

+ (instancetype)showWithBlock:(void(^)(NSString * sn))block{
    DTPerfectIdentityShowView * view = [DTPerfectIdentityShowView show:block];
    return view;
}

+ (instancetype)show:(void(^)(NSString * sn))block{

    DTPerfectIdentityShowView * view = [DTPerfectIdentityShowView new];
    view.block = block;
    [[NSNotificationCenter defaultCenter] addObserver:view
                                             selector:@selector(keyboardWillShow:)
                                                 name:UIKeyboardWillShowNotification
                                               object:nil];
    
    [[NSNotificationCenter defaultCenter] addObserver:view
                                             selector:@selector(keyboardWillHide:)
                                                 name:UIKeyboardWillHideNotification
                                               object:nil];
    
    view.backgroundColor = KcolorHex(@"#00000088");
    view.frame = CGRectMake(0, 0, SCREEN_WIDTH, SCREEN_HEIGHT);
    UIWindow * kwywindow = [UIApplication sharedApplication].keyWindow;
    [kwywindow addSubview:view];
    
    UIView * makeView = [UIView new];
    view.makeView = makeView;
    makeView.backgroundColor = UIColor.whiteColor;
    makeView.frame = CGRectMake(0, SCREEN_HEIGHT, SCREEN_WIDTH, kwt(170) + KSafeAreaBottomHeight);
    [view addSubview:makeView];
    [DTKTool BFYJ:kwt(15) andView:makeView andCorner:UIRectCornerTopLeft|UIRectCornerTopRight andSize: CGRectMake(0, 0 ,SCREEN_WIDTH, kwt(170) + KSafeAreaBottomHeight)];
    
    [UIView animateWithDuration:0.25 animations:^{
        makeView.frame = CGRectMake(0, SCREEN_HEIGHT - (kwt(170) + KSafeAreaBottomHeight), SCREEN_WIDTH ,  kwt(170) + KSafeAreaBottomHeight);
    }];
    
//    view.userInteractionEnabled = YES;
//    [view addGestureRecognizer:[[UITapGestureRecognizer alloc]initWithTarget:view action:@selector(dissmis)]];
    makeView.userInteractionEnabled = YES;
    [makeView addGestureRecognizer:[[UITapGestureRecognizer alloc]initWithTarget:view action:@selector(noclick)]];
    
    UIView *nameView = [[UIView alloc]init];
    [makeView addSubview:nameView];
    [DTKTool YJBK:kwt(23) andView:nameView andWidth:0.5 andColor:KcolorHex(@"#186CFE")];
    [nameView mas_makeConstraints:^(MASConstraintMaker *make) {
        make.left.offset(kwt(20));
        make.width.offset(kwt(290));
        make.top.offset(kwt(20));
        make.height.offset(kwt(46));
    }];
    
    UIButton * exitBtn = [UIButton buttonWithType:UIButtonTypeCustom];
    exitBtn.addNormalText(@"取消").addNormalColor(KcolorHex(@"#1E2425")).addFont(kFont(16));
    [exitBtn addTarget:view action:@selector(dissmis) forControlEvents:UIControlEventTouchUpInside];
    [makeView addSubview:exitBtn];
    [exitBtn mas_makeConstraints:^(MASConstraintMaker *make) {
        make.centerY.equalTo(nameView);
        make.width.height.offset(kwt(35));
        make.right.offset(kwt(-15));
    }];
    
    
 
    
    UITextField * nameText = [[UITextField alloc]init];
    view.nameText = nameText;
    [nameView addSubview:nameText];
    nameText.delegate = view;
    nameText.placeholder = @"请输入S/N";
    nameText.font = [UIFont systemFontOfSize:16];
    [nameText mas_makeConstraints:^(MASConstraintMaker *make) {
        make.left.offset(kwt(22));
        make.right.offset(kwt(-22));
        make.top.offset(0);
        make.bottom.offset(0);
    }];
    
    
    UIButton * tjBtn = [UIButton buttonWithType:UIButtonTypeCustom];
    [tjBtn setTitle:@"确认" forState:UIControlStateNormal];
    [tjBtn setTitleColor:UIColor.whiteColor forState:UIControlStateNormal];
    [tjBtn setBackgroundImage:[UIImage imageNamed:@"login_button1"] forState:UIControlStateNormal];
    tjBtn.titleLabel.font = kCFont(17);
    [DTKTool YJ:kwt(23) andView:tjBtn];
    [makeView addSubview:tjBtn];
    [tjBtn addTarget:view action:@selector(tjBntclick) forControlEvents:UIControlEventTouchUpInside];
    [tjBtn mas_makeConstraints:^(MASConstraintMaker *make) {
        make.left.offset(kwt(20));
        make.right.offset(kwt(-20));
        make.top.equalTo(nameView.mas_bottom).offset(22);
        make.height.offset(kwt(46));
    }];
    [nameText becomeFirstResponder];
    
    
    return view;
}
- (void)tjBntclick{
    NSString * str =[self.nameText.text stringByReplacingOccurrencesOfString:@" " withString:@""];
    if(self.block){
        self.block(str);
    }
    if(str.length > 0){
        [UIView animateWithDuration:0.25 animations:^{
            self.makeView.frame = CGRectMake(0, SCREEN_HEIGHT, SCREEN_WIDTH,kwt(170) + KSafeAreaBottomHeight);
        } completion:^(BOOL finished) {
            [self.subviews makeObjectsPerformSelector:@selector(removeFromSuperview)];
            [self removeFromSuperview];
        }];
    } else {
        [self showWarning:@"请输入S/N"];
    }
    
}


- (void)keyboardWillHide:(NSNotification *)notif {
    //获取键盘的高度
    NSDictionary *userInfo = [notif userInfo];
    CGFloat dutation = [[userInfo objectForKey:UIKeyboardAnimationDurationUserInfoKey] floatValue];
    [UIView animateWithDuration:dutation animations:^{
        self.makeView.frame = CGRectMake(0, SCREEN_HEIGHT - kwt(170) - KSafeAreaBottomHeight, SCREEN_WIDTH, kwt(170) + KSafeAreaBottomHeight);
    }];
}


- (void)keyboardWillShow:(NSNotification *)notif {
    NSDictionary *userInfo = [notif userInfo];
    NSValue *value = [userInfo objectForKey:UIKeyboardFrameEndUserInfoKey];
    CGRect keyboardRect = [value CGRectValue];
    CGFloat height = keyboardRect.size.height;
    //获取键盘动画时长
    CGFloat dutation = [[userInfo objectForKey:UIKeyboardAnimationDurationUserInfoKey] floatValue];
    
    [UIView animateWithDuration:dutation animations:^{
        self.makeView.frame = CGRectMake(0, SCREEN_HEIGHT - height - kwt(170) - KSafeAreaBottomHeight , SCREEN_WIDTH,kwt(170) + KSafeAreaBottomHeight);
    }];
    
}
- (void)noclick{}
- (void)dissmis{
    if(self.block){
        self.block(@"");
    }
    [UIView animateWithDuration:0.25 animations:^{
        self.makeView.frame = CGRectMake(0, SCREEN_HEIGHT, SCREEN_WIDTH,kwt(170) + KSafeAreaBottomHeight);
    } completion:^(BOOL finished) {
        [self.subviews makeObjectsPerformSelector:@selector(removeFromSuperview)];
        [self removeFromSuperview];
    }];
}

@end

@interface SCExitShowView ()
@property (nonatomic ,strong) UIView * makeView;

@end

@implementation SCExitShowView
+ (instancetype)showview{
    
    SCExitShowView * view = [SCExitShowView new];
    [[DTKTool getCurrentVC].view addSubview:view];
    view.backgroundColor = [UIColor colorWithWhite:0 alpha:0.5];
    view.frame = CGRectMake(0, 0, SCREEN_WIDTH, SCREEN_HEIGHT);
    
    UIView * makeView = [UIView new];
    view.makeView = makeView;
    makeView.backgroundColor = UIColor.whiteColor;
    makeView.frame = CGRectMake(kwt(37.5), (SCREEN_HEIGHT - kwt(165))/2, SCREEN_WIDTH - kwt(75), kwt(165));
    [view addSubview:makeView];
    [DTKTool YJ:kwt(10) andView:makeView];
    
    view.userInteractionEnabled = YES;
    [view addGestureRecognizer:[[UITapGestureRecognizer alloc]initWithTarget:view action:@selector(dissmis)]];
    makeView.userInteractionEnabled = YES;
    [makeView addGestureRecognizer:[[UITapGestureRecognizer alloc]initWithTarget:view action:@selector(noclick)]];
    
    UILabel * titlab = [DTKTool labelWithText:@"确定要退出当前账号吗?" andFont:kCFont(18) andTextColor:KcolorHex(@"#1E2425")];
    [makeView addSubview:titlab];
    titlab.textAlignment = NSTextAlignmentCenter;
    [titlab mas_makeConstraints:^(MASConstraintMaker *make) {
        make.centerX.offset(0);
        make.top.offset(kwt(36));
        make.width.offset(kwt(245));
    }];
    
    UIButton * qxbtn = [UIButton buttonWithType:UIButtonTypeCustom];
    qxbtn.backgroundColor = UIColor.whiteColor;
    [qxbtn setTitle:@"暂不" forState:UIControlStateNormal];
    [qxbtn setTitleColor:KcolorHex(@"#1E2425") forState:UIControlStateNormal];
    qxbtn.titleLabel.font = kCFont(16);
    [DTKTool YJBK:kwt(24) andView:qxbtn andWidth:0.5 andColor:KcolorHex(@"#C9C9C9")];
    [qxbtn addTarget:view action:@selector(leftBtnclick) forControlEvents:UIControlEventTouchUpInside];
    [makeView addSubview:qxbtn];
    [qxbtn mas_makeConstraints:^(MASConstraintMaker *make) {
        make.height.offset(kwt(48));
        make.width.offset(kwt(120));
        make.left.offset(kwt(24));
        make.bottom.offset(kwt(-23));
    }];
    
    UIButton * qrbtn = [UIButton buttonWithType:UIButtonTypeCustom];
    [qrbtn setBackgroundImage:[UIImage imageNamed:@"login_button1"] forState:UIControlStateNormal];
    [qrbtn setTitle:@"确定" forState:UIControlStateNormal];
    [qrbtn setTitleColor:UIColor.whiteColor forState:UIControlStateNormal];
    qrbtn.titleLabel.font = kCFont(16);
    [DTKTool YJ:kwt(24) andView:qrbtn];
    [qrbtn addTarget:view action:@selector(rightbtnclick) forControlEvents:UIControlEventTouchUpInside];
    [makeView addSubview:qrbtn];
    [qrbtn mas_makeConstraints:^(MASConstraintMaker *make) {
        make.height.offset(kwt(48));
        make.width.offset(kwt(120));
        make.right.offset(kwt(-24));
        make.bottom.offset(kwt(-23));
    }];
    
    [view show];
    
    return  view;
    
    
}

- (void)leftBtnclick{
    [self dissmis];
}
- (void)rightbtnclick{
    [SCNetManger PostapplogoutWithDict:@{} andCompetionHandlerBlock:^(id  _Nonnull model) {
        NSLog(@"退出登录不管接口返回什么情况");
        [UserInfoModel deleteAccount];
        [self dissmis];

    }];
}


- (void)show{
    [UIView animateWithDuration:0.25 animations:^{
        self.makeView.frame = CGRectMake(kwt(37.5), (SCREEN_HEIGHT - kwt(165))/2, SCREEN_WIDTH - kwt(75), kwt(165));
    }];
}
- (void)noclick{}
- (void)dissmis{
    [UIView animateWithDuration:0.25 animations:^{
        self.makeView.frame = CGRectMake(SCREEN_HEIGHT, (SCREEN_HEIGHT - kwt(165))/2, SCREEN_WIDTH - kwt(75), kwt(165));
    } completion:^(BOOL finished) {
        [self.subviews makeObjectsPerformSelector:@selector(removeFromSuperview)];
        [self removeFromSuperview];
    }];
}

@end
//提交的
@interface SCTJTipsShowView ()

@property (nonatomic ,strong) UIView * makeView;
@property (nonatomic ,strong) GYWclickBlock leftblock;
@property (nonatomic ,strong) GYWclickBlock rightblock;
@property (nonatomic ,assign) CGFloat viewH;

@end
@implementation SCTJTipsShowView
+ (instancetype)showviewTitle:(NSString *)title andContent:(NSString *)content andLeftStr:(NSString *)leftStr andRightStr:(NSString *)rightStr andLeftBlock:(GYWclickBlock)leftblock andRightBlock:(GYWclickBlock)rightblock {
    
    SCTJTipsShowView * view = [SCTJTipsShowView new];
    view.leftblock = leftblock;
    view.rightblock = rightblock;
    [[DTKTool getCurrentVC].view addSubview:view];
    view.backgroundColor = [UIColor colorWithWhite:0 alpha:0.5];
    view.frame = CGRectMake(0, 0, SCREEN_WIDTH, SCREEN_HEIGHT);
    if(content.length < 1){
        view.viewH = kwt(145);
    } else {
        view.viewH = kwt(175);
    }
    UIView * makeView = [UIView new];
    view.makeView = makeView;
    makeView.backgroundColor = UIColor.whiteColor;
    makeView.frame = CGRectMake(kwt(37.5), (SCREEN_HEIGHT - view.viewH)/2, SCREEN_WIDTH - kwt(75),view.viewH);
    [view addSubview:makeView];
    [DTKTool YJ:kwt(10) andView:makeView];
    
    view.userInteractionEnabled = YES;
    [view addGestureRecognizer:[[UITapGestureRecognizer alloc]initWithTarget:view action:@selector(dissmis)]];
    makeView.userInteractionEnabled = YES;
    [makeView addGestureRecognizer:[[UITapGestureRecognizer alloc]initWithTarget:view action:@selector(noclick)]];
    
    UILabel * titlab = [DTKTool labelWithText:title andFont:kFont(18) andTextColor:KcolorHex(@"#1E2425")];
    [makeView addSubview:titlab];
    titlab.numberOfLines = 2;
    titlab.textAlignment = NSTextAlignmentCenter;
    [titlab mas_makeConstraints:^(MASConstraintMaker *make) {
        make.centerX.offset(0);
        make.top.offset(kwt(30));
        make.width.offset(kwt(245));
    }];
    if(content.length > 0){
        UILabel * contentlab = [DTKTool labelWithText:content andFont:kFont(16) andTextColor:KcolorHex(@"#EBAF07")];
        [makeView addSubview:contentlab];
        contentlab.textAlignment = NSTextAlignmentCenter;
        [contentlab mas_makeConstraints:^(MASConstraintMaker *make) {
            make.centerX.offset(0);
            make.top.equalTo(titlab.mas_bottom).offset(kwt(16));
        }];
        
    }
   
    UIButton * qxbtn = [UIButton buttonWithType:UIButtonTypeCustom];
    qxbtn.backgroundColor = UIColor.whiteColor;
    [qxbtn setTitle:leftStr forState:UIControlStateNormal];
    [qxbtn setTitleColor:KcolorHex(@"#1E2425") forState:UIControlStateNormal];
    qxbtn.titleLabel.font = kCFont(16);
    [DTKTool YJBK:kwt(24) andView:qxbtn andWidth:0.5 andColor:KcolorHex(@"#C9C9C9")];
    [qxbtn addTarget:view action:@selector(leftBtnclick) forControlEvents:UIControlEventTouchUpInside];
    [makeView addSubview:qxbtn];
    [qxbtn mas_makeConstraints:^(MASConstraintMaker *make) {
        make.height.offset(kwt(48));
        make.width.offset(kwt(120));
        make.left.offset(kwt(24));
        make.bottom.offset(kwt(-20));
    }];
    
    UIButton * qrbtn = [UIButton buttonWithType:UIButtonTypeCustom];
    [qrbtn setBackgroundImage:[UIImage imageNamed:@"login_button1"] forState:UIControlStateNormal];
    [qrbtn setTitle:rightStr forState:UIControlStateNormal];
    [qrbtn setTitleColor:UIColor.whiteColor forState:UIControlStateNormal];
    qrbtn.titleLabel.font = kCFont(16);
    [DTKTool YJ:kwt(24) andView:qrbtn];
    [qrbtn addTarget:view action:@selector(rightbtnclick) forControlEvents:UIControlEventTouchUpInside];
    [makeView addSubview:qrbtn];
    [qrbtn mas_makeConstraints:^(MASConstraintMaker *make) {
        make.height.offset(kwt(48));
        make.width.offset(kwt(120));
        make.right.offset(kwt(-24));
        make.bottom.offset(kwt(-20));
    }];
    
    [view show];
    
    return  view;
    
    
}

- (void)leftBtnclick{
    if(self.leftblock){
        self.leftblock();
    }
    [self dissmis];
}
- (void)rightbtnclick{
    if(self.rightblock){
        self.rightblock();
    }
    [self dissmis];
}


- (void)show{
    [UIView animateWithDuration:0.25 animations:^{
        self.makeView.frame = CGRectMake(kwt(37.5), (SCREEN_HEIGHT - self.viewH)/2, SCREEN_WIDTH - kwt(75), self.viewH);
    }];
}
- (void)noclick{}
- (void)dissmis{
    [UIView animateWithDuration:0.25 animations:^{
        self.makeView.frame = CGRectMake(SCREEN_HEIGHT, (SCREEN_HEIGHT - self.viewH)/2, SCREEN_WIDTH - kwt(75), self.viewH);
    } completion:^(BOOL finished) {
        [self.subviews makeObjectsPerformSelector:@selector(removeFromSuperview)];
        [self removeFromSuperview];
    }];
}


@end




@interface SCWLRShowView ()

@property (nonatomic ,strong) UIView * makeView;
@property (nonatomic ,strong) GYWclickBlock leftblock;
@property (nonatomic ,strong) GYWclickBlock rightblock;

@end
@implementation SCWLRShowView


+ (instancetype)showviewWithImg:(NSString *)img andContent:(NSString *)content  andContent1:(NSString *)content1 LeftStr:(NSString *)leftStr andRightStr:(NSString *)rightStr andLeftBlock:(GYWclickBlock)leftblock andRightBlock:(GYWclickBlock)rightblock{

    SCWLRShowView * view = [SCWLRShowView new];
    view.leftblock = leftblock;
    view.rightblock = rightblock;
    [[DTKTool getCurrentVC].view addSubview:view];
    view.backgroundColor = [UIColor colorWithWhite:0 alpha:0.5];
    view.frame = CGRectMake(0, 0, SCREEN_WIDTH, SCREEN_HEIGHT);
    
    UIView * makeView = [UIView new];
    view.makeView = makeView;
    makeView.backgroundColor = UIColor.whiteColor;
    makeView.frame = CGRectMake(kwt(37.5), (SCREEN_HEIGHT - kwt(275))/2, SCREEN_WIDTH - kwt(75), kwt(275));
    [view addSubview:makeView];
    [DTKTool YJ:kwt(10) andView:makeView];
    
    view.userInteractionEnabled = YES;
    [view addGestureRecognizer:[[UITapGestureRecognizer alloc]initWithTarget:view action:@selector(dissmis)]];
    makeView.userInteractionEnabled = YES;
    [makeView addGestureRecognizer:[[UITapGestureRecognizer alloc]initWithTarget:view action:@selector(noclick)]];
    UIImageView * topimg = kimageView(img);
    topimg.contentMode = UIViewContentModeScaleAspectFit;
    [makeView addSubview:topimg];
    [topimg mas_makeConstraints:^(MASConstraintMaker *make) {
        make.centerX.offset(0);
        make.top.offset(kwt(20));
        make.width.height.offset(kwt(100));
    }];
    UILabel * titlab = [DTKTool labelWithText:content andFont:kCFont(16) andTextColor:KcolorHex(@"#1E2425")];
    [makeView addSubview:titlab];
    titlab.textAlignment = NSTextAlignmentCenter;
    [titlab mas_makeConstraints:^(MASConstraintMaker *make) {
        make.centerX.offset(0);
        make.top.offset(kwt(135));
        make.width.offset(kwt(255));
    }];
    
    UILabel * titlab1 = [DTKTool labelWithText:content1 andFont:kFont(16) andTextColor:KcolorHex(@"#1E2425")];
    [makeView addSubview:titlab1];
    titlab1.textAlignment = NSTextAlignmentCenter;
    [titlab1 mas_makeConstraints:^(MASConstraintMaker *make) {
        make.centerX.offset(0);
        make.top.offset(kwt(165));
        make.width.offset(kwt(255));
    }];
  
    UIButton * qxbtn = [UIButton buttonWithType:UIButtonTypeCustom];
    qxbtn.backgroundColor = UIColor.whiteColor;
    [qxbtn setTitle:leftStr forState:UIControlStateNormal];
    [qxbtn setTitleColor:KcolorHex(@"#1E2425") forState:UIControlStateNormal];
    qxbtn.titleLabel.font = kCFont(16);
    [DTKTool YJBK:kwt(24) andView:qxbtn andWidth:0.5 andColor:KcolorHex(@"#C9C9C9")];
    [qxbtn addTarget:view action:@selector(leftBtnclick) forControlEvents:UIControlEventTouchUpInside];
    [makeView addSubview:qxbtn];
    [qxbtn mas_makeConstraints:^(MASConstraintMaker *make) {
        make.height.offset(kwt(48));
        make.width.offset(kwt(120));
        make.left.offset(kwt(24));
        make.bottom.offset(kwt(-20));
    }];
    
    UIButton * qrbtn = [UIButton buttonWithType:UIButtonTypeCustom];
    [qrbtn setBackgroundImage:[UIImage imageNamed:@"login_button1"] forState:UIControlStateNormal];
    [qrbtn setTitle:rightStr forState:UIControlStateNormal];
    [qrbtn setTitleColor:UIColor.whiteColor forState:UIControlStateNormal];
    qrbtn.titleLabel.font = kCFont(16);
    [DTKTool YJ:kwt(24) andView:qrbtn];
    [qrbtn addTarget:view action:@selector(rightbtnclick) forControlEvents:UIControlEventTouchUpInside];
    [makeView addSubview:qrbtn];
    [qrbtn mas_makeConstraints:^(MASConstraintMaker *make) {
        make.height.offset(kwt(48));
        make.width.offset(kwt(120));
        make.right.offset(kwt(-24));
        make.bottom.offset(kwt(-20));
    }];
    
    [view show];
    
    return  view;
    
    
}

- (void)leftBtnclick{
    if(self.leftblock){
        self.leftblock();
    }
    [self dissmis];
}
- (void)rightbtnclick{
    if(self.rightblock){
        self.rightblock();
    }
    [self dissmis];
}


- (void)show{
    [UIView animateWithDuration:0.25 animations:^{
        self.makeView.frame = CGRectMake(kwt(37.5), (SCREEN_HEIGHT - kwt(275))/2, SCREEN_WIDTH - kwt(75), kwt(275));
    }];
}
- (void)noclick{}
- (void)dissmis{
    [UIView animateWithDuration:0.25 animations:^{
        self.makeView.frame = CGRectMake(SCREEN_HEIGHT, (SCREEN_HEIGHT - kwt(275))/2, SCREEN_WIDTH - kwt(75), kwt(275));
    } completion:^(BOOL finished) {
        [self.subviews makeObjectsPerformSelector:@selector(removeFromSuperview)];
        [self removeFromSuperview];
    }];
}


@end
